home *** CD-ROM | disk | FTP | other *** search
- /*============================================================
-
- N_PICT sample program2
-
- ============================================================*/
- #include "N_Library.h"
-
- void Bt_Check(void);
- short Data_Rsrc = 0;
- long wait;
-
- void main(void)
- {
- short i;
- WindowPtr window;
-
- ToolboxInit();
- ColorCheck();
- HideCursor();
- window = GetNewWindow (129,nil,(WindowPtr)-1L );
- ShowWindow(window);
- SetWTitle(window,"\pWindow1");
- N_Window_Set_Multi(1,window,-(window->portBits.bounds.left),-(window->portBits.bounds.top),320,240);
- window = GetNewWindow (129,nil,(WindowPtr)-1L );
- MoveWindow(window,-(window->portBits.bounds.left)+100,-(window->portBits.bounds.top)+100,false);
- SetWTitle(window,"\pWindow2");
- ShowWindow(window);
- N_Window_Set_Multi(0,window,-(window->portBits.bounds.left),-(window->portBits.bounds.top),320,240);//set up multi mode setting
-
- Open_Resource_File(128,1,&Data_Rsrc);
- N_Pict_Draw(129,0,0,0,false);
- N_Pict_Draw(130,0,0,0,false);
- Close_Resource_File(&Data_Rsrc);
-
- for (i=0;i!=60;i++)
- {
- N_Current_Window_Set(0); //change target window
- N_Pict_Draw(130,0,0,(GrafPtr)Main_Window,true);
- N_Current_Window_Set(1);
- N_Pict_Draw(130,0,0,(GrafPtr)Main_Window,true);
- N_Current_Window_Set(2);
- N_Pict_Draw(129,0,0,(GrafPtr)Main_Window,true);
- N_Current_Window_Set(0);
- N_Pict_Draw(129,0,0,(GrafPtr)Main_Window,true);
- N_Current_Window_Set(1);
- N_Pict_Draw(129,0,0,(GrafPtr)Main_Window,true);
- N_Current_Window_Set(2);
- N_Pict_Draw(130,0,0,(GrafPtr)Main_Window,true);
- Bt_Check();
- }
- Delay(10,&wait);
-
- do
- {
- for (i=1;i!=17;i++) //(Ef0)
- {
- N_Current_Window_Set(0);
- N_Pict_Effect (129,0,0,0,i,0);
- N_Current_Window_Set(1);
- N_Pict_Effect (129,0,0,0,i,0);
- Bt_Check();
- }
-
- for (i=16;i!=0;i--) //(Ef0)
- {
- N_Current_Window_Set(0);
- N_Pict_Effect (130,0,0,0,i,0);
- N_Current_Window_Set(1);
- N_Pict_Effect (130,0,0,0,i,0);
- Bt_Check();
- }
- Delay(30,&wait);
-
- for (i=1;i!=16;i++) //(Ef1)
- {
- N_Current_Window_Set(0);
- N_Pict_Effect (129,0,0,1,15,i);
- N_Current_Window_Set(1);
- N_Pict_Effect (129,0,0,1,15,i);
- Bt_Check();
- }
- Delay(30,&wait);
-
- for (i=1;i!=16;i++) //(Ef2)
- {
- N_Current_Window_Set(0);
- N_Pict_Effect (130,0,0,2,15,i);
- N_Current_Window_Set(1);
- N_Pict_Effect (130,0,0,2,15,i);
- Bt_Check();
- }
- Delay(30,&wait);
-
- N_Current_Window_Set(0);
- N_Pict_Effect (129,0,0,3,0,0); //(Ef3)
- N_Current_Window_Set(1);
- N_Pict_Effect (129,0,0,3,0,0); //(Ef3)
- for (i=0;i!=256;i++)
- {
- N_Current_Window_Set(0);
- N_Pict_Effect (129,0,0,3,1,0);
- N_Current_Window_Set(1);
- N_Pict_Effect (129,0,0,3,1,0);
- Bt_Check();
- }
- Delay(30,&wait);
-
-
- for (i=1;i!=17;i++) //(Ef0)
- {
- N_Current_Window_Set(0);
- N_Pict_Effect (129,0,0,0,i,0);
- N_Current_Window_Set(1);
- N_Pict_Effect (129,0,0,0,i,0);
- Bt_Check();
- }
-
- for (i=16;i!=0;i--) //(Ef0)
- {
- N_Current_Window_Set(0);
- N_Pict_Effect (130,0,0,0,i,0);
- N_Current_Window_Set(1);
- N_Pict_Effect (130,0,0,0,i,0);
- Bt_Check();
- }
- Delay(30,&wait);
-
- for (i=1;i!=9;i++) //(Ef2)
- {
- N_Current_Window_Set(0);
- N_Pict_Effect (129,0,0,2,8,i);
- N_Current_Window_Set(1);
- N_Pict_Effect (129,0,0,2,8,i);
- Bt_Check();
- }
- Delay(30,&wait);
-
- for (i=1;i!=9;i++) //(Ef1)
- {
- N_Current_Window_Set(0);
- N_Pict_Effect (130,0,0,1,8,i);
- N_Current_Window_Set(1);
- N_Pict_Effect (130,0,0,1,8,i);
- Bt_Check();
- }
- Delay(30,&wait);
-
- N_Current_Window_Set(0);
- N_Pict_Effect (129,0,0,3,0,0); //(Ef3)
- N_Current_Window_Set(1);
- N_Pict_Effect (129,0,0,3,0,0); //(Ef3)
-
- for (i=0;i!=256;i++)
- {
- N_Current_Window_Set(0);
- N_Pict_Effect (129,0,0,3,1,0);
- N_Current_Window_Set(1);
- N_Pict_Effect (129,0,0,3,1,0);
- Bt_Check();
- }
- Delay(30,&wait);
- }
- while (true);
- }
-
- void Bt_Check(void)
- {
- if (Button()==true)
- {
- ColorRevert();
- ShowCursor();
- ExitToShell();
- }
- }
-